<template>
  <a-locale-provider :locale="locale">
    <div id="app">
      <router-view/>
    </div>
  </a-locale-provider>
</template>
<script>
  import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
  import enquireScreen from '@/utils/device'

  export default {
    data () {
      return {
        locale: zhCN,
      }
    },
    created () {
      let that = this
      enquireScreen(deviceType => {
        // tablet
        if (deviceType === 0) {
          that.$store.commit('TOGGLE_DEVICE', 'mobile')
          that.$store.dispatch('setSidebar', false)
        }
        // mobile
        else if (deviceType === 1) {
          that.$store.commit('TOGGLE_DEVICE', 'mobile')
          that.$store.dispatch('setSidebar', false)
        }
        else {
          that.$store.commit('TOGGLE_DEVICE', 'desktop')
          that.$store.dispatch('setSidebar', true)
        }

      })
    }
  }
</script>
<style>
  /*.no-left .ant-tree-switcher{*/
  /*   width: 0 !important;*/
  /*}*/
  .print-show-style .tox-toolbar__group:last-child .tox-tbtn:nth-child(2){
    display: none !important;
  }
  .width-mad-style .ant-form-item{
   margin-bottom: 0 !important;
  }
  .width-mad-style .tox-tinymce{
    min-height: 520px !important;
  }
  .width-mad-style .ant-form-item-control-wrapper{
    width: 100% !important;
  }
  .width-mad-style{
    width: 98% !important;
    top: 20px !important;
  }
  #app {
    height: 100%;
  }
</style>